<template>
  <div class="home">
   <div class="homeNav clearfix">
   	 <div class="city-gd">广州</div>
   	  <div class="link clearfix">
   	  	  <span ><router-link to="/home/playing" >正在热映</router-link></span>
   	  	  <span><router-link to="/home/comming" >即将上映</router-link></span>
   	  	  <img src="../../../../image/下载 (9).png" />
   	  	 
   	  </div>
  
   </div>
   	   <hr class="homeHr"/>
        <!-- home下的子路由  children -->
    <router-view />
   
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'home',
  created(){
  	console.log(this.axios)
  	
  	//请求  -->本地服务器 (webpack的devServer) -->猫眼的服务器
  	// this.axios.get('/maoyan/ajax/movieOnInfoList').then((res)=>{
  	// 	console.log("正在热映",res)
  		
		// 	this.movieList= res.data.movieList
		
  	// })
  },
  data(){
  	return {
  		movieList:[],
			isplaying:true,
			iscomming:false
  	}
	},
	
  methods:{
        toMovie(id){
        	this.$router.push({name:"movie",params:{movieId:id}})
        },
 
  toAbout(){
  	
  	//路由对象的方法，push就是跳转
  	//queery 查询字符串的参数 /about?id=4396&name=777
//	this.$router.push({path:'/about',
//		query:{
//			id:4396
//		}
//	})
    //跳转到命名路由     传参使用params
  	this.$router.push({name:'about',
  		  params:{
  		  	id:4396
  		  }
  	})
  	
  },
  
  //		/home/:id/comming
tomy(){
//	this.$router.push({
//		name:'comming',
//		params:{
//			Id:1234
//		}
//	})
}
  },
  components: {
    HelloWorld
  }
}
</script>
